#include <stdio.h>
#include <string.h>
#include <stdlib.h>

#define TXT_MAXLEN	10000


unsigned int *
prefix_func(const char *str, const int len, int *pi)
{
	int k = 0;
	int q;

	pi[0] = 0;
	for (q = 1; q < len; ++q) {
		while (k > 0 && str[k] != str[q])
			k = pi[k - 1];
		if (str[k] == str[q])
			k++;
		pi[q] = k;
	}

	return pi;
}

long
substrings(const char *s)
{
	const long length = strlen(s);
	int i;
	register int k;
	int *pi;

	pi = (int *) calloc(length, sizeof *pi);

	for (i = 2; i < length; ++i) {
		prefix_func(s, i, pi);
		for (k = 0; k < i; ++k)
			if (max_pi > pi[k])
				max_pi = pi[k];
		;
	}
}

int
main(void)
{
	char text[TXT_MAXLEN+2];
	(void) fgets(text, TXT_MAXLEN + 1, stdin);
	printf("%d\n", substrings(text));
	return 0;
}
